package Server.entity;

import lombok.Data;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.GenericGenerator;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import javax.validation.constraints.NotNull;

/**
 * Entity - 用户收货地址
 *
 * @author xvzhe
 * @version 0.1
 *
 */
@Data
@Entity
@EntityListeners(AuditingEntityListener.class)
@DynamicInsert
@DynamicUpdate
public class UserSite {
    @Id
    @GeneratedValue(generator = "NumberIdProduce")
    @GenericGenerator(name="NumberIdProduce", strategy="Server.tool.NumberIdProduce")
    private String uuid;

    /*
    *
    * 地址
    *
    * */
    @Column
    @NotNull
    private String site;

    /*
    *
    * 电话
    *
    * */

    @Column
    @NotNull
    private String mobile;


    /*
    *
    *
    * 收货人
    *
    * */
    @Column
    @NotNull
    private String people;

    @Column(columnDefinition="int default 0")
    private Integer isBank;

    @ManyToOne
    @JoinColumn(name = "userId")
    private  Users users;


    public String getUuid() {
        return uuid;
    }

    public void setUuid(String uuid) {
        this.uuid = uuid;
    }

    public String getSite() {
        return site;
    }

    public void setSite(String site) {
        this.site = site;
    }

    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    public String getPeople() {
        return people;
    }

    public void setPeople(String people) {
        this.people = people;
    }

    public Users getUsers() {
        return users;
    }

    public void setUsers(Users users) {
        this.users = users;
    }

    public Integer getIsBank() {
        return isBank;
    }

    public void setIsBank(Integer isBank) {
        this.isBank = isBank;
    }
}
